﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue queue = new Queue();
            queue.Enqueue(12);
            queue.Enqueue(13);

            Queue queue1 = new Queue(queue);//复制元素
            
            foreach(var v in queue)
            {
                Console.WriteLine(v);
            }

            Console.WriteLine(queue.Contains(12));//判断是否存在

            //复制到数组
            object[] y = queue.ToArray();
            foreach (var p in y)
            {
                Console.WriteLine(p);
            }


            //peek

            Queue queue2 = new Queue();
            queue2.Enqueue(15);
            queue2.Peek();  //返回但不移除

            foreach (var u in queue2)
            {
                Console.WriteLine(u);
            }


            Queue queue4 = new Queue();
            queue4.Enqueue("1号");
            queue4.Enqueue("2号");
            queue4.Enqueue("3号");
            Console.WriteLine("游戏开始：");
            while (queue4.Count != 0)
            {
                Console.WriteLine(queue4.Dequeue() + "已完成");
            }
            Console.WriteLine("游戏结束！");






        }
    }
}
